<include file="public@header"/>

<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="{:url('Information/index')}">待办信息列表</a></li>
        <li><a href="{:url('Information/add')}">添加</a></li>
    </ul>
    <form class="well form-inline margin-top-20 row" method="post" action="{:url('Information/index')}">
        <label class="col-md-4 form-group" style="margin-bottom: 15px;">
            所属校区:
            <select class="form-control" name="school_id" >
                <option value='0'>全部</option>
                <notempty name="campus">
                    <volist name="campus" id="vo">
                        <if condition="isset($param.school_id) && $param.school_id == $vo.id">
                            <option value="{$vo.id}" selected>{$vo.name}</option>
                        <else/>
                            <option value="{$vo.id}">{$vo.name}</option>
                        </if>
                    </volist>
                </notempty>
            </select>
        </label>

        <label class="col-md-4  form-group" style="margin-bottom: 15px;">
            关键字:
            <input type="text" class="form-control" name="keywords"
                   value="{$param.keywords|default=''}" placeholder="请输入关键字">
        </label>

        <label class="col-md-4  form-group" style="margin-bottom: 15px;">
            状态:
            <select class="form-control" name="status" >
                <option value='-1'>全部</option>
                <if condition="isset($param.status) && $param.status == 0">
                    <option value="0" selected>待办</option>
                <else/>
                    <option value="0">待办</option>
                </if>
                <if condition="isset($param.status) && $param.status == 1">
                    <option value="1" selected>已处理</option>
                <else/>
                    <option value="1">已处理</option>
                </if>
            </select>
        </label>

        <label class="form-group col-md-8 col-xs-9">
            完成时间:
            <input type="text" class="form-control" name="start" value="{$param.start|default=''}"
                   autocomplete="off"> -
            <input type="text" class="form-control" name="end" value="{$param.end|default=''}"
                   autocomplete="off">
        </label>

        <label class="col-md-4 col-xs-3 form-group">
            <input type="submit" class="btn btn-primary" value="搜索"/>
            <a class="btn btn-danger" href="{:url('Information/index')}">清空</a>
        </label>
    </form>

    <form class="js-ajax-form" action="" method="post">
        <div class="table-actions">
        <button class="btn btn-danger btn-sm js-ajax-submit" type="submit"
                data-action="{:url('Information/delete')}" data-subcheck="true" data-msg="您确定删除吗？">
                批量删除
        </button>
    </div>
        <table class="table table-hover table-bordered table-list">
            <thead>
            <tr>
                <th width="15">
                    <label>
                        <input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x">
                    </label>
                </th>

                <th>编号</th>
                <th>标题</th>
                <th>内容</th>
                <th>校区</th>
                <th>创建者</th>
                <th>创建时间</th>
                <th>完成者</th>
                <th>完成时间</th>
                <th>状态</th>
                <th>操作</th>
            </tr>
            </thead>
            <notempty name="info">
                <foreach name="info" item="vo">
                    <tr>
                        <td>
                            <input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]"
                                   value="{$vo.id}" title="ID:{$vo.id}">
                        </td>
                        <td>{$vo.id}</td>
                        <td>{$vo.title}</td>
                        <td>{$vo.content}</td>
                        <td>{$vo.campus_name}</td>
                        <td>{$vo.u_name}</td>
                        <td>{:date('Y-m-d H:i:s',$vo.create_time)}</td>
                        <td>{$vo.solved_name}</td>
                        <if condition="$vo.solved_time">
                            <td>{:date('Y-m-d H:i:s',$vo.solved_time)}</td>
                        <else/>
                            <td></td>
                        </if>
                        <if condition="$vo.status eq 1">
                            <td><span class="label label-success">已处理</span></td>
                        <else/>
                            <td><span class="label label-warning">待办</span></td>
                        </if>
                        <td>
                            <a href="{:url('Information/edit',array('id'=>$vo['id']))}">{:lang('EDIT')}</a> |
                            <a href="{:url('Information/delete',array('id'=>$vo['id']))}" class="js-ajax-delete">{:lang('DELETE')}</a>
                        </td>
                    </tr>
                </foreach>
            </notempty>
        </table>
        <div class="pagination">{$page|default=''}</div>
    </form>
</div>

<script src="__STATIC__/js/admin.js"></script>
<script type="text/javascript">
    $('input[name="start"]').datepicker();
    $('input[name="end"]').datepicker();
</script>
</body>
